package cn.mafangui.hotel.service.impl;

import cn.mafangui.hotel.entity.Dishes;
import cn.mafangui.hotel.entity.DishesManager;
import cn.mafangui.hotel.mapper.DishesManagerMapper;
import cn.mafangui.hotel.mapper.DishesMapper;
import cn.mafangui.hotel.service.DishesManagerService;
import cn.mafangui.hotel.service.DishesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DishesManagerServiceImpl implements DishesManagerService {

    @Autowired
    private DishesManagerMapper dishesManagerMapper;

    @Override
    public int insert(DishesManager notice) {
        return dishesManagerMapper.insert(notice);
    }

    @Override
    public int delete(Integer dishId) {
        return dishesManagerMapper.deleteByPrimaryKey(dishId);
    }

    @Override
    public DishesManager selectById(Integer id) {
        return dishesManagerMapper.selectByPrimaryKey(id);
    }

    @Override
    public int update(DishesManager record) {
        return dishesManagerMapper.updateByPrimaryKey(record);
    }

    @Override
    public Integer getDishesCount() {
        return dishesManagerMapper.getDishesCount();
    }


    @Override
    public List<DishesManager> AllDishesManager() {
        return dishesManagerMapper.selectAll();
    }

    @Override
    public boolean updatePay(String id, String pay) {
        return dishesManagerMapper.updatePay(Integer.parseInt(id),pay);
    }
}
